package com.daydayup.learn.redisLimit;


import cn.hutool.core.util.IdUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@Slf4j
@RestController
public class RedisLimitController {

    @GetMapping("/redis/limit/test")
    @RedisLimitAnnotation(key = "redisLimit", permitsPerSecond = 3, expire = 10,msg = "访问人数太多,被限流了")
    public String redisLimit() {
        return "正常业务返回,订单流水:"+ IdUtil.simpleUUID();
    }
}
